<script setup lang="ts">
defineComponent({
  name: 'BlogContent'
})
defineProps({
  // 是否只显示版心内容
  onlyContent: {
    type: Boolean,
    default: false
  },
  // 侧边 和 内容块 是否翻转
  reverse: {
    type: Boolean,
    default: false
  }
})
</script>

<template>
  <div class="app-container">
    <slot></slot>
    <div class="content-wrapper">
      <template v-if="reverse">
        <div class="right-content" style="margin-right: 16px;">
          <slot name="sidebar"></slot>
        </div>
        <div class="left-content">
          <slot name="content"></slot>
        </div>
      </template>
      <template v-else>
        <div class="left-content" style="margin-right: 16px;">
          <slot name="content"></slot>
        </div>
        <div class="right-content">
          <slot name="sidebar"></slot>
        </div>
      </template>
    </div>
  </div>
</template>

<style scoped lang="scss">
.app-container {
  display: flex;
  justify-content: space-between;
  flex-direction: column;
  margin: $blog-nav-height auto 0;
  max-width: 1160px;
  min-width: 1160px;

  .content-wrapper {
    display: flex;
    .left-content {
      width: calc(1160px - 16px - 296px);
    }

    .right-content {

      width:296px;
    }
  }

}
</style>
